import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  server: {
    port: 3000,
    proxy: {
      //代理会去监听前端发起的请求
      //key是字符串，url关键词
      '/api': {
        target: "http://localhost:8080",
        changeOrigin: true,
        rewrite:(path)=>path.replace(/^\/api/,"")

      }

    }
  }
})
